<template>
    <div class="model" v-show="show">
        <p>这是一个model框组件中的内容</p>
        <input type="text" v-model="value1">{{value1}}
        <el-button @click="close">关闭model</el-button>
    </div>
</template>

<script>
    export default {
        name:'model',
        props:{
            show:{
                type:Boolean,
                default:''
            }
        },
        data(){
            return{
                value1:10
            }
        },
        //定制v-model
        model:{
            prop:'show',
            event:'close'
        },
        created(){
        },
        methods:{
            close(){
                this.$emit('close',false) //输出input
            }
        }
    }
</script>

<style scoped>
    .model{
        width: 200px;
        border: 1px solid red;
    }
</style>